Remove the assertions that x_offset and y_offset must be >= 0. Clip the
authorJoe Shaw <joe@ximian.com>
Fri, 18 May 2001 03:41:30 +0000 (03:41 +0000)
committerJoe Shaw <joeshaw@src.gnome.org>
Fri, 18 May 2001 03:41:30 +0000 (03:41 +0000)
2001-05-17  Joe Shaw  <joe@ximian.com>

* gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions
that x_offset and y_offset must be >= 0. Clip the cursor being drawn
if it is only partially onscreen.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktextdisplay.c

index 119501f6c5549c4e16fd38e8e140cee86c748334..d74580a8bc54bd10f1a4e2807d70cd1dc0b2acfa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-05-17  Joe Shaw  <joe@ximian.com>
+
+       * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions
+       that x_offset and y_offset must be >= 0. Clip the cursor being drawn
+       if it is only partially onscreen.
+
 Thu May 17 17:10:13 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkentry.c: Make logical motion and deletion by graphemes, 
index 119501f6c5549c4e16fd38e8e140cee86c748334..d74580a8bc54bd10f1a4e2807d70cd1dc0b2acfa 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-17  Joe Shaw  <joe@ximian.com>
+
+       * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions
+       that x_offset and y_offset must be >= 0. Clip the cursor being drawn
+       if it is only partially onscreen.
+
 Thu May 17 17:10:13 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkentry.c: Make logical motion and deletion by graphemes, 
index 119501f6c5549c4e16fd38e8e140cee86c748334..d74580a8bc54bd10f1a4e2807d70cd1dc0b2acfa 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-17  Joe Shaw  <joe@ximian.com>
+
+       * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions
+       that x_offset and y_offset must be >= 0. Clip the cursor being drawn
+       if it is only partially onscreen.
+
 Thu May 17 17:10:13 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkentry.c: Make logical motion and deletion by graphemes, 
index 119501f6c5549c4e16fd38e8e140cee86c748334..d74580a8bc54bd10f1a4e2807d70cd1dc0b2acfa 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-17  Joe Shaw  <joe@ximian.com>
+
+       * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions
+       that x_offset and y_offset must be >= 0. Clip the cursor being drawn
+       if it is only partially onscreen.
+
 Thu May 17 17:10:13 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkentry.c: Make logical motion and deletion by graphemes, 
index 119501f6c5549c4e16fd38e8e140cee86c748334..d74580a8bc54bd10f1a4e2807d70cd1dc0b2acfa 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-17  Joe Shaw  <joe@ximian.com>
+
+       * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions
+       that x_offset and y_offset must be >= 0. Clip the cursor being drawn
+       if it is only partially onscreen.
+
 Thu May 17 17:10:13 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkentry.c: Make logical motion and deletion by graphemes, 
index 119501f6c5549c4e16fd38e8e140cee86c748334..d74580a8bc54bd10f1a4e2807d70cd1dc0b2acfa 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-17  Joe Shaw  <joe@ximian.com>
+
+       * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions
+       that x_offset and y_offset must be >= 0. Clip the cursor being drawn
+       if it is only partially onscreen.
+
 Thu May 17 17:10:13 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkentry.c: Make logical motion and deletion by graphemes, 
index 119501f6c5549c4e16fd38e8e140cee86c748334..d74580a8bc54bd10f1a4e2807d70cd1dc0b2acfa 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-17  Joe Shaw  <joe@ximian.com>
+
+       * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions
+       that x_offset and y_offset must be >= 0. Clip the cursor being drawn
+       if it is only partially onscreen.
+
 Thu May 17 17:10:13 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkentry.c: Make logical motion and deletion by graphemes, 
index 0b2c3f78725346b8737341c20333eab3654e44ea..c06c7cb4877d371272a912eef2b53509c337343b 100644 (file)
@@ -698,8 +698,6 @@ gtk_text_layout_draw (GtkTextLayout *layout,
   g_return_if_fail (layout->default_style != NULL);
   g_return_if_fail (layout->buffer != NULL);
   g_return_if_fail (drawable != NULL);
-  g_return_if_fail (x_offset >= 0);
-  g_return_if_fail (y_offset >= 0);
   g_return_if_fail (width >= 0);
   g_return_if_fail (height >= 0);
 
@@ -794,11 +792,13 @@ gtk_text_layout_draw (GtkTextLayout *layout,
               else
                 gc = widget->style->text_gc[GTK_STATE_NORMAL];
 
+              gdk_gc_set_clip_rectangle(gc, &clip);
               gdk_draw_line (drawable, gc,
                              line_display->x_offset + cursor->x - x_offset,
                              current_y + line_display->top_margin + cursor->y,
                              line_display->x_offset + cursor->x - x_offset,
                              current_y + line_display->top_margin + cursor->y + cursor->height - 1);
+              gdk_gc_set_clip_rectangle(gc, NULL);
 
               cursor_list = cursor_list->next;
             }